<!-- addcourse:#tab1   Author:liuricheng     Time:2013-08-28 -->

{/* Import Js,Css */}
	<js href="__PUBLIC__/js/core/plugins.js"/>
{/* Import js,Css */}

<style>
._tab1 *{vertical-align:middle;}.mb10{margin-bottom:10px;}._tab1 select{border:1px solid #848484;height:25px;width:225px;}
.lovingtips{background:url(__PUBLIC__/image/admin/bg_notice.gif) no-repeat 0px 0px; display:inline-block; width:16px; height:16px; cursor:pointer;}
</style>

<div class="_tab1">
	<table  id="mytab"  border="1" class="t1" width="100%">
		<!--课程名称-->
		<tr>
			<td align="right" width="30%">
				课堂名称
			</td>
			<td height="50">
				<input type="text" class="input mp10 mb10"  name="name" value=""/>&nbsp;&nbsp;&nbsp;
				<span class="h_50 redtext">*</span>&nbsp;&nbsp;&nbsp;
				<b class="lovingtips" title="必须填写"></b>
			</td>
		</tr>
		<!--课程分类-->
		<tr>
			<th align="right">
				课堂分类
			</th>
			<td height="50">
				<select id="category" class="mp10 mb10" name="course_category_id" value="">
					<option value="">{$lang.please_select_cat_name}</option>
					<volist name="courseCatList" id="courseCat">
						<option value="{$courseCat.id}">{$courseCat.name}</option>
					</volist>
				</select>&nbsp;&nbsp;&nbsp;
				<span class="h_50 redtext">*</span>&nbsp;&nbsp;&nbsp;
				<b class="lovingtips" title="请选择分类"></b>
				<span id="categoryValue" class="h_50" title=""></span>
			</td>
		</tr>
		<!--拓展分类-->
		<tr>
			<th align="right">
				拓展分类&nbsp;&nbsp;&nbsp;<a href="javascript:addOtherCat();" style="color:red;">[+添加]</a> 
			</th>
			<td height="50">				
				<div id="other_category">
					<select class="mp10 mb10" name="other_cat_id[]" value="">
						<option value="">请选择拓展分类</option>
						<volist name="courseCatList" id="courseCat">
							<option value="{$courseCat.id}">{$courseCat.name}</option>
						</volist>
					</select>
				</div>
			</td>
		</tr>
		<!--课程年龄分类-->
		<tr>
			<th align="right">
				{$lang.age_area}
			</th>
			<td height="50">
				<select id="age_area" name="age_id" class="mp10 mb10">
					<volist name="agesList" id="ages">
						<option value="{$ages.id}">{$ages.name}</option>
					</volist>					
				</select>
			</td>
		</tr>
		<!--课堂提供商-->
		<tr>
			<th align="right">
				提供商
			</th>
			<td>
				<select id="cat_id" class="mp10 mb10" name="supplier_id" value="">
					<volist name="supplierList" id="supplier">
						<option value="{$supplier.id}">{$supplier.name}</option>
					</volist>		
				</select>
			</td>
		</tr>
		<!--课堂价值积分-->
		<tr>
			<th align="right">
				{$lang.price}
			</th>
			<td>
				<input type="text" class="input mp10 mb10" name="integration" value=""/>
			</td>
		</tr>	
		<!--课堂是否有效-->		
		<tr>
			<th align="right">
				{$lang.is_show}
			</th>
			<td>
				<input type="checkbox" name="invalid" value="0"/>&nbsp;{$lang.yes}&nbsp;
				<input type="checkbox" name="invalid" value="1"/>&nbsp;{$lang.no}
				<b class="lovingtips" title="若课程直接上架选择是"></b>
			</td>
		</tr>
		<!--课堂是否最新-->
		<tr>
			<th align="right">
				{$lang.is_new}
			</th>
			<td>
				<input type="checkbox" name="new" value="1"/>&nbsp;{$lang.yes}&nbsp;
				<input type="checkbox" name="new" value="0"/>&nbsp;{$lang.no}
				<b class="lovingtips" title="设置课程为最新课程,选择是"></b>
			</td>
		</tr>
		<!--课堂是否最热-->
		<tr>
			<th align="right">
				{$lang.is_hot}
			</th>						
			<td>
				<input type="checkbox" name="hot" value="1" />&nbsp;{$lang.yes}&nbsp;
				<input type="checkbox" name="hot" value="0" />&nbsp;{$lang.no}
				<b class="lovingtips" title="设置课程为最热课程,选择是"></b>
			</td>
		</tr>
		<!--课堂排序-->
		<tr>
			<th align="right">
				课堂排序
			</th>						
			<td>
				<input type="text"  class="input mp10 mb10" name="sort" value="50" /> 
				<b style="color:red;">*</b>&nbsp; 
				<b class="lovingtips" title="根据课程的顺序进行排序"></b>&nbsp;&nbsp;&nbsp;默认为50，必须是一个数字 
			</td>
		</tr>
	</table>
</div>

<script type="text/javascript">
	//添加拓展分类
	function addOtherCat(){
		var other_category_panel	=	$('#other_category');
		var select_obj				=	other_category_panel.find('select:first');
		var select_clone			=	select_obj.clone();
		//insert after
		other_category_panel.append(select_clone);
	}
	
	$(document).ready(function(){		
		/* 气泡提示框 */
		$('a[title]').qtip({ 
			style: { name: 'green'/* black,cream,green,dark,light,red,blue */, tip: true },
			position: { adjust: { screen: true } } /* 根据位置自动调整 */
		});
		/* 填写提示 */
		$('b[title]').qtip({ 
			style: { name: 'green'/* black,cream,green,dark,light,red,blue */, tip: true },
			position: { adjust: { screen: true } } /* 根据位置自动调整 */
		});
		
		$('#nihao').click(function(){
			$('#loading').QLoading({'text':'处理中','status':'open','model':true});
		});
			// 显示分类的全称
		$("#category").change(function(){
			var cat_id = $("#category").val();
			$.ajax({
				url:"__URL__/ajaxCourse",
				data:{'cat_id':cat_id,'action':'cat_select'},
				dataType:'json',
				type:'post',
				beforeSend:function(){
					$('#loading').QLoading({'text':'处理中','status':'open','model':false});
				},
				success:function(msg){				
					if(msg.data == '1'){
						$('#categoryValue').text(msg.info);
						$('#loading').QLoading({'text':msg.info,'status':'close','time':0.5,'img':'happy','model':false});
					}
					else{
						$('#loading').QLoading({'text':msg.info,'status':'close','time':2,'img':'sad','model':false});
					}
				}
			});
			
		});
	});
</script>







